package com.carlinfo.stu_ques.users.dao.impl;

import java.io.File;

import com.carlinfo.stu_ques.common.dao.impl.BaseDaoimpl;
import com.carlinfo.stu_ques.users.dao.IStudentsDao;
import com.carlinfo.stu_ques.users.pojo.Students;

public class StudentDaosimpl extends BaseDaoimpl<Students> implements IStudentsDao
{
	Students studend = new Students();
	File file = new File(parentFile, "students.dat");
	public StudentDaosimpl()
	{
		readFile(file);
	}
 
	@Override
	public int savaOneDao(Students student)
	{
		student.setId(count);
		tempId = student.getId();
		super.savaOneDao(student);
		writeFile(file);
		return tempId;
	}
	
	@Override
	public void updateOneDao(Students student)
	{
		tempId = student.getId();
		super.updateOneDao(student);
		writeFile(file);
	}

	@Override
	public void deleteOneDao(Students student)
	{
		tempId = student.getId();
		super.deleteOneDao(student);
		writeFile(file);
	}	

}
